home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / domácnost a kancelar / opencontacts / setup.exe / {app} / DataSet / Templates / default.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-08-18  |  3.3 KB  |  114 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <!--For basic HTML rendering of QuickView
  3. This template generally does not require translation. However, you may want to change styles.
  4. -->
  5. <xsl:stylesheet version="1.0"
  6. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  7. <xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8" />
  8.  
  9.   <xsl:template match="/">
  10.     <html>
  11.  
  12.       <body>
  13.         <xsl:for-each select="OpenContacts/Contacts/Contact">
  14.  
  15.           <table border="0" width="100%" id="table2">
  16.             <tr>
  17.               <td width="80%">
  18.                 <font face="Times New Roman" size="3">
  19.                   <b>
  20.                     <xsl:value-of select="@Name"/>
  21.                   </b>
  22.                 </font>
  23.               </td>
  24.               <td>
  25.                 <xsl:value-of select="@Title"/>
  26.               </td>
  27.             </tr>
  28.           </table>
  29.           <div style="margin-left: 15px;">
  30.  
  31.             <font size="2" color="#800000">
  32.                 <xsl:apply-templates select="Notes"/>
  33.             </font>
  34.  
  35.  
  36.           </div>
  37.           <xsl:for-each select="Sections/Section">
  38.             <div style="margin-left: 15px;">
  39.  
  40.  
  41.               <b>
  42.                 <font face="Times New Roman" size="2">
  43.                   <xsl:value-of select="@Name"/>
  44.                 </font>
  45.               </b>
  46.             </div>
  47.  
  48.  
  49.  
  50.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  51.               <xsl:for-each select="Fields/Field">
  52.                 <tr>
  53.                   <td width="15"></td>
  54.                   <td width="80" bgcolor="#C3D9FF">
  55.                     <font face="Times New Roman" size="2">
  56.                       <xsl:value-of select="@Name"/>:
  57.                     </font>
  58.                   </td>
  59.                   <td bgcolor="#E0ECFF">
  60.                     <font size="3">
  61.                       <xsl:value-of select="@Value"/>
  62.                     </font>
  63.                   </td>
  64.                 </tr>
  65.               </xsl:for-each>
  66.  
  67.             </table>
  68.  
  69.             <div style="margin-left: 15px;">
  70.  
  71.               <font size="2" color="#800000">
  72.                 <xsl:apply-templates select="Notes"/>
  73.               </font>
  74.  
  75.  
  76.             </div>
  77.  
  78.           </xsl:for-each>
  79.  
  80.           <p>  </p>
  81.         </xsl:for-each>
  82.       </body>
  83.     </html>
  84.   </xsl:template>
  85.  
  86.   <xsl:template match="Notes">
  87.       <xsl:call-template name="substitute">
  88.          <xsl:with-param name="string" select="." />
  89.       </xsl:call-template>
  90. </xsl:template>
  91.  
  92.  <xsl:template name="substitute">
  93.    <xsl:param name="string" />
  94.    <xsl:param name="from" select="' '" />
  95.    <xsl:param name="to">
  96.       <p/>
  97.    </xsl:param>
  98.    <xsl:choose>
  99.       <xsl:when test="contains($string, $from)">
  100.          <xsl:value-of select="substring-before($string, $from)" />
  101.          <xsl:copy-of select="$to" />
  102.          <xsl:call-template name="substitute">
  103.             <xsl:with-param name="string"
  104.                             select="substring-after($string, $from)" />
  105.             <xsl:with-param name="from" select="$from" />
  106.             <xsl:with-param name="to" select="$to" />
  107.          </xsl:call-template>
  108.       </xsl:when>
  109.       <xsl:otherwise>
  110.          <xsl:value-of select="$string" />
  111.       </xsl:otherwise>
  112.    </xsl:choose>
  113. </xsl:template>                
  114. </xsl:stylesheet>